<template>
	<view class="content">
		
		<view class="formConImg">
			<view class="title">
				<view class="left">
					<view class="line"></view>
					<view class="text">历史跟进记录5条</view>
				</view>
				<view class="add" @click="FollowUpDetail">新增跟进</view>
			</view>
			<view class="lists">
				<view class="li">
					<view class="text">与张总进行线下拜访</view>
					<view class="status">合作中</view>
					<view class="num">初访 <span>2024年1月23日  10:12</span></view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello',
				tabList: [{
						text: '客户'
					},
					{
						text: '跟进'
					},
					{
						text: '附件'
					}
				],
				tabActive: 0,
				array: [{
						name: '男',
						value: 0
					},
					{
						name: '女',
						value: 1
					}
				],
				sexIndex: -1,
				tops: 0,
				height: 0,
				datetimesingle:''
			}
		},
		onLoad() {

			uni.getSystemInfo({

				success: (e) => {

					this.tops = e.statusBarHeight;

					let custom = uni.getMenuButtonBoundingClientRect();

					this.height = custom.height + (custom.top - e.statusBarHeight) * 2;

				}

			})

		},
		methods: {
			FollowUpDetail(){
				uni.navigateTo({
					url: "/pages/FollowUpDetail/index"
				})
			},
			changeLog(e) {
				console.log('change事件:', e);
			},
			goBack() {
				uni.navigateBack()
			},
			interactRecord() {
				uni.navigateTo({
					url: "/pages/interactRecord/index"
				})
			},
			addSeniorData() {
				uni.navigateTo({
					url: "/pages/addSeniorData/index"
				})
			},
			tabChange(index) {
				this.tabActive = index
			},
			history() {
				uni.navigateTo({
					url: '/pages/customerHistory/index'
				})
			},

			getMapLocation() {
				let that = this
				uni.chooseLocation({
					success: (res) => {
						// 将获取到的地址信息存储
						this.address = res.address
						console.log(666, res)
					},
					fail: () => {
						// 如果用uni.chooseLocation没有获取到地理位置，则需要获取当前的授权信息，判断是否有地理授权信息
						uni.getSetting({
							success: (res) => {
								var status = res.authSetting;
								if (!status['scope.userLocation']) {
									// 如果授权信息中没有地理位置的授权，则需要弹窗提示用户需要授权地理信息
									uni.showModal({
										title: "是否授权当前位置",
										content: "需要获取您的地理位置，请确认授权，否则地图功能将无法使用",
										success: (tip) => {
											if (tip.confirm) {
												// 如果用户同意授权地理信息，则打开授权设置页面，判断用户的操作
												uni.openSetting({
													success: (data) => {
														// 如果用户授权了地理信息在，则提示授权成功
														if (data
															.authSetting[
																'scope.userLocation'
															] === true
														) {
															uni.showToast({
																title: "授权成功",
																icon: "success",
																duration: 1000
															})
															// 授权成功后，然后再次chooseLocation获取信息
															uni.chooseLocation({
																success: (
																	res
																) => {
																	// 将获取到的地址信息存储
																	this.address =
																		res
																		.address
																}
															})
														} else {
															uni.showToast({
																title: "授权失败",
																icon: "none",
																duration: 1000
															})
														}
													}
												})
											}
										}
									})
								}
							},
							fail: (res) => {
								uni.showToast({
									title: "调用授权窗口失败",
									icon: "none",
									duration: 1000
								})
							}
						})
					}
				});
			},

		}
	}
</script>

<style>
	.header {
		width: 100%;
		height: 100rpx;
		line-height: 90rpx;
		position: fixed;
		top: 0;
		text-align: center;
		background-color: white;
	}

	.header .back {
		width: 20rpx;
		height: 40rpx;
		margin-left: 30rpx;
		margin-top: 30rpx;
		float: left;
	}

	.header .name {
		height: 100%;
		line-height: 90rpx;
		margin-top: 7rpx;
	}

	.header .history {
		width: 40rpx;
		height: 40rpx;
		position: absolute;
		right: 50rpx;
		top: 33rpx;
		color: #008BDE;

	}

	/*#ifdef MP-WEIXIN*/
	.header .name {
		width: 35%;
		line-height: 90rpx;
		margin-right: 50rpx;
		float: left;
	}

	.header .history {
		float: left;
		position: initial;
		color: #008BDE;
		margin-top: 30rpx;
	}

	/*#endif*/
	.tabList {
		width: 90%;
		height: 70rpx;
		line-height: 70rpx;
		border: 1rpx solid #008BDE;
		margin: auto;
		font-size: 28rpx;
		margin-top: 130rpx;
		/*#ifdef MP-WEIXIN*/
		margin-top: 160rpx;
		/*#endif*/
		display: flex;
	}

	.tabList .li {
		width: 33%;
		text-align: center;
		color: #008BDE;
	}
	.tabList .li:nth-of-type(2){
		border-left: 1rpx solid #008BDE;
		border-right: 1rpx solid #008BDE;
	}

	.tabActive {
		background-color: #008BDE;
		color: white !important;
	}

	.formCon {
		width: 90%;
		margin: auto;
		margin-top: 50rpx;
		font-size: 26rpx;
		padding-bottom: 100rpx;
	}

	.formCon .li {
		width: 100%;
		height: 60rpx;
		display: flex;
		justify-content: space-between;
		margin-top: 0rpx;
	}
    .formCon .li .name{
		font-weight: bold;
	}
	.formCon .li input {
		width: 44%;
		height: 80rpx;
		border-radius: 10rpx;
		padding-left: 20rpx;
		border: 1rpx solid #ccc;
		font-size: 26rpx;
	}
    .formCon .li .time{
		color: #999;
	}
	.formCon .li .picker-box {
		width: 44%;
		height: 80rpx;
		border-radius: 10rpx;
		padding-left: 20rpx;
		border: 1rpx solid #ccc;
		font-size: 26rpx;
		position: relative;
	}

	.formCon .li .picker-box view {
		margin-top: 22rpx;
	}

	.formCon .li .picker-box image {
		width: 50rpx;
		height: 50rpx;
		position: absolute;
		right: 20rpx;
		top: 18rpx;
	}

	.formCon .li_1 {
		display: flex;
		margin-top: 20rpx;
	}

	.formCon .li_1 input {
		width: 86%;
		height: 80rpx;
		border-radius: 10rpx;
		padding-left: 20rpx;
		border: 1rpx solid #ccc;
		font-size: 26rpx;
	}

	.formCon .li_1 image {
		width: 60rpx;
		height: 60rpx;
		margin-left: 20rpx;
		margin-top: 14rpx;
	}

	.formCon .li_2 {
		display: flex;
		margin-top: 20rpx;
		border: 1rpx solid #ccc;
		border-radius: 10rpx;
	}

	.formCon .li_2 input {
		width: 86%;
		height: 80rpx;
		border-radius: 10rpx;
		padding-left: 20rpx;
		font-size: 26rpx;
	}

	.formCon .li_2 image {
		width: 60rpx;
		height: 60rpx;
		margin-right: 20rpx;
		margin-top: 14rpx;
	}

	.addOther {
		width: 400rpx;
		height: 80rpx;
		line-height: 80rpx;
		background: #008BDE;
		color: white;
		display: flex;
		justify-content: space-between;
		margin-top: 20rpx;
	}

	.addOther view {
		margin-left: 50rpx;
	}

	.addOther image {
		width: 50rpx;
		height: 50rpx;
		margin-top: 13rpx;
		margin-right: 50rpx;
	}
	
	.lists{
		width: 100%;
		margin: auto;
		font-size: 26rpx;
	}
    .lists .li{
		line-height: 50rpx;
		margin-top: 20rpx;
		border-bottom: 1rpx solid #f5f5f5;
		padding-bottom: 20rpx;
	}
	.lists .li .text{
		color: #008BDE;
	}
	.lists .li .status{
		color: #A4579D;
	}
	.lists .li .num{
		color: #999;
	}
	.formConImg {
		width: 90%;
		margin: auto;
		margin-top: 30rpx;
	}

	.formConImg .title {
		width: 100%;
		margin: auto;
		margin-top: 20rpx;
		display: flex;
		position: relative;
	}
	.formConImg .title .add{
		width: 160rpx;
		height: 50rpx;
		line-height: 50rpx;
		text-align: center;
		border-radius: 10rpx;
		position: absolute;
		right: 0;
		font-size: 26rpx;
		background-color: #008BDE;
		color: white;
	}
	.formConImg .title  .left{
		width: 100%;
		display: flex;
	}
	.formConImg .title .line {
		width: 7rpx;
		height: 40rpx;
		margin-top: 6rpx;
		background-color: #008BDE;
	}

	.formConImg .title .text {
		margin-left: 20rpx;
		margin-top: 3rpx;
	}

	.formConImg .li {
		margin-top: 40rpx;
	}

	.imgList {
		margin-top: 20rpx;
	}
	.imgList image{
		width: 100rpx;
		height: 100rpx;
		margin-left: 20rpx;
	}

	/deep/ .icon-add {
		width: 50rpx;
	}

	.btn {
		width: 80%;
		height: 80rpx;
		line-height: 80rpx;
		border-radius: 80rpx;
		color: white;
		margin: auto;
		background-color: #008BDE;
		margin-top: 50rpx;
		font-size: 26rpx;
	}

	.callPhone {
		width: 90%;
		margin: auto;
		text-align: right;
		margin-bottom: 20rpx;
	}

	.phone {
		width: 40rpx;
		height: 40rpx;
	}
	/deep/ .uni-date-x--border{
		border: 1rpx solid #ccc;
		height:84rpx;
	}
	/deep/ .uni-date{
		/* width: 60% !important; */
		float: left !important;
	}
</style>